BrokenRatControls [Easy] – Solution

Objective:

To identify and exploit insecure access controls within a simulated PHP web application that includes both authenticated and admin-only functionality, some of which is improperly protected.

Step 1: Initial Reconnaissance

The application provides a login interface with two test accounts:

The interface hinted at different permissions depending on the logged-in user’s role.

Step 2: Authentication

Logged in as each user to confirm access levels:

Step 3: Role-Based Access Control Review

The backend logic used a session-stored role to restrict access via conditionals in a switch statement. Example:

if ($role !== 'admin') {
    echo "<h3>Access Denied</h3>";
    break;
}

Step 4: Discovery of Broken Access Controls

Two critical admin endpoints did not include any role validation:

case 'export_data':
    // Normally admin-only, but missing role check

case 'shutdown_system':
    // Normally admin-only, but missing role check
Hint: The login screen even mentioned that these two endpoints were accessible but shouldn’t be!

Step 5: Exploitation

While logged in as lowpriv, manually accessing:

Successfully triggered the admin functionality without proper authorization.

Step 6: Mitigation Suggestions

Conclusion

This lab highlighted the impact of broken access control mechanisms. Sensitive functionality like data export and system shutdown was accessible to low-privilege users due to missing server-side role validation. It’s a strong reminder of the importance of secure coding practices and consistent access enforcement.

Back to Lab Overview